package demo2;

public class test {

    public static void main(String[] args) throws InterruptedException {
        Object lock=new Object();

        Thread t3 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                synchronized (lock) {
                    synchronized (lock){
                        synchronized (lock){
                            System.out.print("A");
                        }
                        System.out.print("B");
                    }
                    System.out.println("C");

                }
            }
        });

        t3.start();
        t3.join();
    }
}
